package com.yusys.pattern.regular.oecm.second;

import com.yusys.pattern.regular.oecm.NovelBook;

/**
 * 小说折扣类对象 继承小说类
 */
public class NovelOffPrice extends NovelBook {

    public NovelOffPrice(String name, int price, String author) {
        super(name, price, author);
    }

//    @Override
//    public String getName() {
//        return super.getName();
//    }

    /**
     * 只需要重写获取价格方法
     * @return
     */
    @Override
    public int getPrice() {
        int oldPrice = super.getPrice();
        int offPrice = 0;

        if(oldPrice >40){
            offPrice = oldPrice*90/100;

        }else{
            offPrice = oldPrice;
        }

        return offPrice;
    }

//    @Override
//    public String getAuthor() {
//        return super.getAuthor();
//    }
}
